<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/layouts/include/taglib.jsp" %>

<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta name="decorator" content="step" />
 <script type="text/javascript">
	var parentId = "${param.parentId}";			//项目id; 
</script>
</head>
<body>
<div class="doc-menu">
	 <%@ include file="/jsp/cd/doc/cdDocLeftZtree.jsp" %>	
</div>

<div class="doc-content mdl-130">
	<div id="createFileDiv" class="my-doc-btns">
		<button class="btn-ace f-ml20 createFile" type="button">
				<i class="icon-plus"></i> 新建文件夹
		</button>
		<button class="btn-ace f-ml20 btn-upload" type="button">
				<i class="icon-upload-alt"></i> 上传附件		
		</button>
		 <!-- 进度条  -->
		 <span style="width:30%;display:inline-block;vertical-align: middle;margin-left:20px;">  
			<div class="progress progress-striped active" id="fileActive" style="margin-bottom:0;display: none;">
				<div class="progress-bar progress-bar-success" id="progress" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 0%;">
					<span class="sr-only">上传中</span>
				</div>
			</div>
		</span> 
	</div>

	<div class="my-doc-breadcrumbs">
		<h6 class="text-primary Ordered List Item" id="pathAll">
			<span id="skipFile">全部文件</span>
			<span id="navigationFile">									
			</span>
		</h6>
	</div>
	<div class="my-doc-content">
		<div class="table-responsive">
			<table id="sample-table-1"  class="table table-hover" >
				<thead>
					<tr>
						<th class="center col-xs-1">
							<label>
								<input type="hidden" id="parentId">
								<input type="hidden" id="folderPath">
								<input type="hidden" id="folderPathName">
								<input type="hidden" id="folderChoose">
								<input type="hidden" id="folderName">
								<input type="hidden" id="name">
								<!-- 修改标记 -->
								<input type="hidden" id="updateFolderName">
								<input type="checkbox" class="ace" id="checkBoxChanges" name="checkBoxChanges"/>
								<span class="lbl"></span>
							</label>
						</th>
						<th id="fileName">文件名</th>
						<th>创建时间</th>																
					</tr>
				</thead>
				<!--  新添加文件夹
				<tbody id="cdDocCreateFile">
				
				</tbody> -->
				<!-- 得到相关的数据 -->
				<thead id="cdDocCreateFile">
				
				</thead>
				<tbody id="cdDocDivList">
					
				</tbody>												
			</table>
		</div>
	</div>			
</div>

  <!-- 选择分享方式 -->
        <div class="modal"  id="updateShareModen"><!-- class="modal fade" 添加效果 -->
			<div class="modal-dialog" >
				
				    <div class="modal-content">
				      <div class="modal-header">
				        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
				        <h4 class="modal-title">分享</h4>
				      </div>
				      <div class="row row-content">
				      <form class="form-horizontal" role="form" id="shareModen-form">
				      		<input type="hidden" id="shareUuid">
				      		 <div class="col-sm-10" >
					  		 	  <div class="form-group col-sm-10 ">
									<label class="col-sm-6  control-label" for="roleNo">分享方式</label>
										<div class="col-sm-6 ">
											<tags:select name="shareType" id="shareType" type="cdShareType" hasBlank="true"></tags:select>
										</div>
								</div> 
				        	</div>
						<div id="target">
					  		
				        	 <!-- 个人 -->
				        	 <div class="col-sm-12" id="personDiv">
					  		 	 <div class="form-group col-sm-12">
									<label class="col-sm-4 control-label" for="empName">根据个人分享</label>
										<div class="col-sm-6 ">
											<tags:select type="" dataUrl="/cd/doc/selectPerson.do" hasBlank="true" name="empNo" id="empNo" optionValue="empNo" 
                                             optionName="empName"></tags:select>
										</div>
										<button type="button" class="btn btn-sm btn-checkBox checkBoxButton addPerson" data-toggle="button" value="" >添加</button>
								</div>
								<br/>
				        		<div class="form-group col-sm-10" id="person">
				        			<button type="button" style="display: none"  class="btn btn-xs btn active" data-toggle="button"></button>
				        		</div>
				        	 </div>
				        	<!-- 角色 -->
				        	 <div class="col-sm-12" id="roleDiv">
					        	<div class="form-group col-sm-12">
									<label class="col-sm-4 control-label" for="roleName">根据角色分享</label>
										<div class="col-sm-6">
											<tags:select type="" dataUrl="/cd/doc/selectRole.do" hasBlank="true" name="roleNo" id="roleNo" optionValue="uuid" 
                                             optionName="roleName"></tags:select> 
										</div>
										<button type="button" class="btn btn-sm btn-checkBox checkBoxButton addRole" data-toggle="button" value="" >添加</button>
								</div>
				        		<div class="form-group col-sm-10" id="role">
				        			<button type="button" style="display: none"  class="btn btn-xs btn active" data-toggle="button"></button>
				        		</div>
				        	</div>
				        	<!-- 项目 -->
				        	 <div class="col-sm-12" id="projectDiv">
					        	<div class="form-group col-sm-12">
									<label class="col-sm-4 control-label" for="prjName">根据项目分享</label>
										<div class="col-sm-6">
											<tags:select type="" hasBlank="true" dataUrl="/cd/doc/selectProjcet.do" name="prjName" id="prjName" optionValue="uuid" optionName="prjName"></tags:select>

										</div>
										<button type="button" class="btn btn-sm btn-checkBox checkBoxButton addProject" data-toggle="button" value="" >添加</button>
								</div>
				        		<div class="form-group col-sm-12" id="project">
				        			<button type="button" style="display: none"  class="btn btn-xs btn active" data-toggle="button"></button>
				        		</div>
				        	</div>
				       </div>
				       </form>
				      </div>
				      <div class="modal-footer" id="updateShareDiv">
				        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				        <button type="button" class="btn btn-primary updateShare" id="stepModen-btn-save" >保存</button>
				      </div>
				    </div><!-- /.modal-content -->
			  	</div><!-- /.modal-dialog -->
		</div><!-- /.modal -->


  <script type="text/javascript" src="${ctx}/jsp/cd/doc/cdDocFileList.js"></script>  
  
  <!-- 列表显示模板 -->
  <script id="showListMtp" type="x-tmpl-mustache">
	{{#data}}
	<tr class="clickTr" name="clickName">
		<td class="center col-xs-1">
			<label>
				<input type="checkbox"  name="changeCheckboxFile" class="ace selectCheck"  value="{{uuid}}"/>
				<span class="lbl"></span>
			</label>	
		</td>
		<td class="cdDocmousedown  col-xs-10" id="{{uuid}}">              
			{{>itemMtpLink}}
		</td>
		<td class=" col-xs-1">{{#formatDt}}{{createDt}}{{/formatDt}}</td>
	</tr>
	{{/data}}
  </script>
  
  <script id="itemMtp" type="x-tmpl-mustache">
			<a name="changeFile"  class="folderCls col-xs-8" href="#" key="{{uuid}}" folderType="{{folderType}}">
				{{#isfolder}}
					<i class="icon-folder-close blue"></i>
				{{/isfolder}}
				{{^isfolder}}
					<i class="icon-book blue"></i>
				{{/isfolder}}
				{{folderName}}
			</a>	
			<div class="pull-right col-xs-4 action-buttons">
				<a class="pull-right bigger-130 updateFileName" href="#" uuid="{{uuid}}"  folderName="{{folderName}}" folderType="{{folderType}}" title="修改"><i class="icon-pencil"></i></a>
				<a class="pull-right bigger-130 shareFileName" href="#" uuid="{{uuid}}" folderName="{{folderName}}" folderType="{{folderType}}" title="分享"><i class=" icon-share"></i></a>
				{{^isfolder}}
					<a class="pull-right red bigger-130 downupLoad" href="#" key="{{uuid}}" title="下载"><i class="icon-download-alt  bigger-80"></i></a>
				{{/isfolder}}
			</div>
  </script>
 	<!--  新建文件夹 -->
  <script id="showCreateFile" type="x-tmpl-mustache">
	<tr>
		<td class="center col-xs-1">
			<label>
				<input type="checkbox" class="ace" />
				<span class="lbl"></span>
			</label>
		</td>
		<td class="cdDocmousedown col-xs-10">
		  <div class="col-xs-8">
			<i class="icon-folder-close blue"></i>
			<input type="text" value="新建文件夹" id="creatFileName"/>
			<button class="btn btn-xs btn-success saveFile" type="button" folderPath="{{folderPath}}" folderPahtName ="{{folderPahtName}}">
				<i class=" icon-ok bigger-110 red"></i>
			</button>
			&nbsp;&nbsp;
			<button class="btn btn-xs btn-success hideFileAddBtn" type="button">
				<i class=" icon-remove bigger-110 blue"></i>
			</button>
		 </div>
		</td>
	</tr>
  
  </script>
</body>
